﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.goods {
    import flash.events.*;
    import flash.display.*;
    import net.wooga.pets.utils.*;

    public class GoodsButton extends Sprite {

        private var _goodsButton:MovieClip;
        private var _buttonContainer:MovieClip;
        private var _visible:Boolean;

        public function init():void{
            this._buttonContainer = AssetsLibrary.getMovieClip("MissionIcon");
            addChild(this._buttonContainer);
            this._goodsButton = AssetsLibrary.getMovieClip("Goods_BoxButtonIcon");
            this._buttonContainer.icon.addChild(this._goodsButton);
            this.hide();
        }
        private function onMouseOut(_arg1:MouseEvent):void{
            this._buttonContainer.gotoAndStop("out");
        }
        private function onMouseOver(_arg1:MouseEvent):void{
            this._buttonContainer.gotoAndStop("over");
        }
        public function get goodsButton():MovieClip{
            return (this._goodsButton);
        }
        public function show():void{
            if (!this._visible){
                this._buttonContainer.gotoAndPlay(2);
                this._visible = true;
                this._buttonContainer.addEventListener(MouseEvent.MOUSE_OVER, this.onMouseOver);
                this._buttonContainer.addEventListener(MouseEvent.MOUSE_OUT, this.onMouseOut);
                this._buttonContainer.buttonMode = true;
            };
        }
        public function hide():void{
            this._buttonContainer.gotoAndStop(1);
            this._buttonContainer.removeEventListener(MouseEvent.MOUSE_OVER, this.onMouseOver);
            this._buttonContainer.removeEventListener(MouseEvent.MOUSE_OUT, this.onMouseOut);
            this._buttonContainer.buttonMode = false;
            this._visible = false;
        }

    }
}//package net.wooga.pets.views.goods 
